math/big.Rat.a (field)
91 uses
math/big (current package)
float.go#L1152: z.a.neg = x.neg
float.go#L1155: z.a.abs = z.a.abs.shl(x.mant, uint(x.exp-allBits))
float.go#L1159: z.a.abs = z.a.abs.set(x.mant)
float.go#L1163: z.a.abs = z.a.abs.set(x.mant)
rat.go#L29: a, b Int
rat.go#L62: z.a.SetUint64(mantissa)
rat.go#L63: z.a.neg = f < 0
rat.go#L68: z.a.Lsh(&z.a, uint(-shift))
rat.go#L278: f, exact = quotToFloat32(x.a.abs, b)
rat.go#L279: if x.a.neg {
rat.go#L294: f, exact = quotToFloat64(x.a.abs, b)
rat.go#L295: if x.a.neg {
rat.go#L304: z.a.neg = a.neg != b.neg
rat.go#L309: if &z.a == b || alias(z.a.abs, babs) {
rat.go#L312: z.a.abs = z.a.abs.set(a.abs)
rat.go#L323: z.a.SetInt64(a)
rat.go#L326: z.a.neg = !z.a.neg
rat.go#L334: z.a.Set(x)
rat.go#L341: z.a.SetInt64(x)
rat.go#L348: z.a.SetUint64(x)
rat.go#L356: z.a.Set(&x.a)
rat.go#L368: z.a.neg = false
rat.go#L375: z.a.neg = len(z.a.abs) > 0 && !z.a.neg // 0 has no sign
rat.go#L382: if len(x.a.abs) == 0 {
rat.go#L386: z.a.abs, z.b.abs = z.b.abs, z.a.abs
rat.go#L396: return x.a.Sign()
rat.go#L409: return &x.a
rat.go#L432: case len(z.a.abs) == 0:
rat.go#L434: z.a.neg = false
rat.go#L441: neg := z.a.neg
rat.go#L442: z.a.neg = false
rat.go#L444: if f := NewInt(0).lehmerGCD(nil, nil, &z.a, &z.b); f.Cmp(intOne) != 0 {
rat.go#L445: z.a.abs, _ = z.a.abs.div(nil, z.a.abs, f.abs)
rat.go#L448: z.a.neg = neg
rat.go#L486: a.scaleDenom(&x.a, y.b.abs)
rat.go#L487: b.scaleDenom(&y.a, x.b.abs)
rat.go#L494: a1.scaleDenom(&x.a, y.b.abs)
rat.go#L495: a2.scaleDenom(&y.a, x.b.abs)
rat.go#L496: z.a.Add(&a1, &a2)
rat.go#L504: a1.scaleDenom(&x.a, y.b.abs)
rat.go#L505: a2.scaleDenom(&y.a, x.b.abs)
rat.go#L506: z.a.Sub(&a1, &a2)
rat.go#L515: z.a.neg = false
rat.go#L516: z.a.abs = z.a.abs.sqr(x.a.abs)
rat.go#L524: z.a.Mul(&x.a, &y.a)
rat.go#L532: if len(y.a.abs) == 0 {
rat.go#L536: a.scaleDenom(&x.a, y.b.abs)
rat.go#L537: b.scaleDenom(&y.a, x.b.abs)
rat.go#L538: z.a.abs = a.abs
rat.go#L540: z.a.neg = a.neg != b.neg
ratconv.go#L66: if _, ok := z.a.SetString(s[:sep], 0); !ok {
ratconv.go#L96: z.a.abs, base, fcount, err = z.a.abs.scan(r, 0, true)
ratconv.go#L115: if len(z.a.abs) == 0 {
ratconv.go#L183: z.a.abs = z.a.abs.mul(z.a.abs, pow5)
ratconv.go#L197: z.a.abs = z.a.abs.shl(z.a.abs, uint(exp2))
ratconv.go#L202: z.a.neg = neg && len(z.a.abs) > 0 // 0 has no sign
ratconv.go#L308: buf = x.a.Append(buf, 10)
ratconv.go#L322: return x.a.String()
ratconv.go#L334: buf = x.a.Append(buf, 10)
ratconv.go#L345: q, r := nat(nil).div(nat(nil), x.a.abs, x.b.abs)
ratconv.go#L365: if x.a.neg {
ratmarsh.go#L24: buf := make([]byte, 1+4+(len(x.a.abs)+len(x.b.abs))*_S) // extra bytes for version and sign bit (1), and numerator length (4)
ratmarsh.go#L26: j := x.a.abs.bytes(buf[:i])
ratmarsh.go#L35: if x.a.neg {
ratmarsh.go#L65: z.a.neg = b&1 != 0
ratmarsh.go#L66: z.a.abs = z.a.abs.setBytes(buf[j:i])
ratmarsh.go#L74: return x.a.MarshalText()
|
The pages are generated with Golds v0.6.7. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |